// import React from 'react'
import {useParams} from 'react-router-dom'
import{loadMedicinesCategoriesAPI} from "../services/yaopinforums"
import { useEffect, useState } from "react";
// import { dalImg } from "../utils/tools";
import YaoPinNavBar from "../components/yaopinNavBar"
function YaoDetail() {
  // const location = useLocation()
  const params = useParams()
  // console.log(location);
  // console.log(params);
  // const searchParams = new URLSearchParams(location.search)
  // console.log(Object.fromEntries(searchParams));
  const [list, setList] = useState({});

  useEffect(() => {
    loadMedicinesCategoriesAPI(params.id).then((res) => {
      // setList(params);
      console.log(res);
      setList(res.data)
    });
  }, []);
  return (
    <div>
      <YaoPinNavBar/>
    <div dangerouslySetInnerHTML={{__html:list.content}}>
    </div>
    </div>
  )
}

export default YaoDetail